<template>
  <div class="app-container-10 container-f0f2f5 app-main feature-list-container">
    <div class="feature-list-content container-fff app-container-15 app-ele-border-radius-0">
      <el-button type="primary" size="small" v-if="isAuth('shop:shopRenovation:save')"  @click="goCreatePage">{{$t('shopFeature.list.newMicroPage')}}</el-button>
      <!--微页面列表-->
      <div class="content-box">
        <el-table
          :data="miniPageList"
          style="width: 100%">
          <el-table-column
            prop="name"
            :label="$i18n.t('shopFeature.list.pageName')"
            >
            <template slot-scope="scope">
            <div>
              {{scope.row.name}}
              <el-tag v-if="scope.row.homeStatus===1" effect="dark" size="mini" style="margin-left: 10px;">{{$t('shopFeature.list.shopHomePage')}}</el-tag>
            </div>
          </template>
          </el-table-column>
          <el-table-column
            prop="createTime"
            :label="$i18n.t('shopFeature.list.createTime')"
          >
          </el-table-column>
          <el-table-column
            prop="updateTime"
            :label="$i18n.t('shopFeature.list.updateTime')"
          >
          </el-table-column>
          <el-table-column
            :label="$i18n.t('shopFeature.list.oper')">
            <template slot-scope="scope">
              <!-- <el-button type="text" size="small">查看</el-button> -->
              <el-button type="text" v-if="isAuth('shop:shopRenovation:update')" @click="handleEdit(scope.row)" size="small">{{$t('shopFeature.list.edit')}}</el-button>
              <el-button type="text" v-if="isAuth('shop:shopRenovation:delete')" @click="handleDelete(scope.row)" size="small">{{$t('shopFeature.list.delete')}}</el-button>
              <el-button type="text" v-if="isAuth('shop:shopRenovation:updateHome')" @click="handleSetHomePage(scope.row.renovationId)" size="small">{{ scope.row.homeStatus!=1 ? $t('shopFeature.list.setHomePage'): $t('shopFeature.list.cancelHomePage')}}</el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          @size-change="sizeChangeHandle"
          @current-change="currentChangeHandle"
          :current-page="pageIndex"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="pageSize"
          :total="totalPage"
          layout="total, sizes, prev, pager, next, jumper"
      ></el-pagination>
      </div>
    </div>
  </div>
</template>

<script>
  import List from './list'

  export default List
</script>
